package com.xzy.spring.demo.selector;

import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

/**
 * @author xzy
 * @date 2021/2/8 21:21
 * 说明：在配置类的@Import中指定本ImportSelector，IOC将导入selectImports返回的所有全限定名对应的类。
 */
public class MyImportSelector implements ImportSelector {
    @Override
    public String[] selectImports(AnnotationMetadata importingClassMetadata) {
        return new String[]{"com.xzy.spring.demo.selector.SelectorBeanA",
                "com.xzy.spring.demo.selector.SelectorBeanB",
                "com.xzy.spring.demo.selector.SelectorBeanC"};
    }
}
